#include "trap.h"
   .set noat
   .globl main
   .text
main:
   li     $at, 0x80000000           # $at = 0x8000_0000 lui ori  
   li     $t0, 0x00000001           # $t0 = 0x0000_0001
   li     $v0, 0x7fffffff           # $v0 = 0x7fff_ffff
   nop
   nop
   # signed
   add    $t1, $at, $t0             # $t1 = 0x8000_0001
   add    $t1, $t0, $v0             # IntegerOverflow
   sub    $t1, $v0, $t0             # $t1 = 0x7fff_fffe
   li     $t2, 0xf2345678
   sub    $t1, $at, $v0             # IntergerOverflow
   slt    $t1, $at, $t0             # $t1 = 1  
   slt    $t1, $v0, $t0             # $t1 = 0 
   slt    $t1, $t2, $at             # $t1 = 1
   # unsigned
   addu   $t1, $at, $t0             # $t1 = 0x8000_0001
   addu   $t1, $at, $v0             # $t1 = 0xffff_ffff
   subu   $t1, $t0, $v0             # $t1 = 0x8000_0002
   subu   $t1, $v0, $t2             # $t1 = 0x8dcb_a987
   subu   $t1, $t2, $at             # $t1 = 0x7234_5678 
   sltu   $t1, $at, $v0             # $t1 = 0
   sltu   $t1, $t0, $v0             # $t1 = 1
   # mult
   mult   $t2, $at                  
   mfhi   $t1                       # $t1 = 0x791a_2b3c
   mflo   $t1                       # $t1 = 0x0000_0000
   mult   $t2, $at                  # negative mult 
   mfhi   $t1                       # $t1 = 0x791a_2b3c
   mflo   $t2                       # $t2 = 0x0000_0000
   mult   $at, $v0                  # negative mult postive
   mfhi   $t1                       # $t1 = 0xbfff_ffff
   mflo   $t2                       # $t2 = 0x0000_0001
   mult   $t0, $v0                  # postive mult 
   mfhi   $t1                       # $t1 = 0x0
   mflo   $t2                       # $t2 = 0x7fff_ffff
   multu  $at, $v0                  
   mfhi   $t1                       # $t1 = 0x3fff_ffff
   mflo   $t2                       # $t2 = 0x8000_0000
   # logic
   li     $v0, 0x56781234           # $v0 = 0x5678_1234
   li     $t2, 0xf2345678           # $t2 = 0xf234_5678
   nop
   nop
   and    $t1, $at, $v0             # $t1 = 0x0
   and    $t1, $t2, $v0             # $t1 = 0x5230_1230
   nor    $t1, $at, $v0             # $t2 = 0x2987_edcb
   nor    $t1, $t2, $v0             # $t1 = 0x0983_a983
   or     $t1, $at, $v0             # $t1 = 0xd678_1234
   or     $t1, $t2, $v0             # $t1 = 0xf67c_567c
   xor    $t1, $at, $v0             # $t2 = 0xd678_1234
   xor    $t1, $t2, $v0             # $t1 = 0xa44c_444c
   HIT_GOOD_TRAP		#stop temu
